import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-04-30
 * Time: 12:47
 *///TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {

    }
    public static void printPyramid(int layer){
        for (int i = 0; i < layer; i++) {
            for (int j = 0; j < layer*2-1; j++) {
                if(i+j<layer-1){
                    System.out.print("\t");
                }
                else if(i+j>=layer-1&&j<layer){
                    System.out.print((int)Math.pow(2,i+j+1-layer)+"\t");
                }else if(j>=layer&&j-i<=layer-1){
                    System.out.print((int)Math.pow(2,-(j-i+1-layer))+"\t");
                }
            }
            System.out.print("\n");
        }
    }
    public static void main4(String[] args) {
        printPyramid(6);

    }
    public static void solveEquation(double a, double b, double c){
        double jud=b*b-4*a*c;
        if(jud<0){
            System.out.println("该方程无实数解。");
        } else if (jud==0) {
            System.out.println("该方程只有一个实数解："+(-b+0)/2.0*a);
        }else{
            System.out.print("该方程有两个实数解：");
            System.out.printf("%.6f,%.6f",(-b+Math.sqrt(jud))/(2.0*a),(-b-Math.sqrt(jud))/(2.0*a));
        }
    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入方程(ax^2+bx+c)中的 a、b、c: ");
        while (scanner.hasNext()) {
            double a = scanner.nextDouble();
            double b = scanner.nextDouble();
            double c = scanner.nextDouble();
            solveEquation(a, b, c);
        }
    }
    public static void printPalinPrime(int m,int n){
        for (int i = m; i <= n; i++) {
            if(isPalinNumber(i)==true){
                System.out.println(i);
            }
        }
    }
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int m= scanner.nextInt();
        int n= scanner.nextInt();
        //printPalinPrime(n);
        printPalinPrime(m,n);
    }
    public static void printPalinPrime(int num){
        int i=0;
        int j=2;
        while(j<=num){
            if(isPalinNumber(i)==true){
                System.out.println(i);
                j++;
            }
            i++;
        }

    }

    public static boolean isPalinNumber(int n) {
        int count = 0;
        int tmp = n;
        while (tmp != 0) {
            tmp /= 10;
            count++;
        }
        int[] arr = new int[20];
        for (int i = 0; i < count; i++) {
            arr[i] = n % 10;
            n /= 10;
        }
        int i = 0;
        for (; i < count / 2; i++) {
            if (arr[i] == arr[count - 1 - i]) {
                if (i == (count / 2) - 1) {

                    return true;
                }
            } else {
                return false;
            }
        }return false;

    }

    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNext()) {
            int n = scanner.nextInt();
            if(isPalinNumber(n)==true){
                System.out.println("是回文数！");
            }else{
                System.out.println("不是回文数！");
            }

        }
    }
}